package com.zbl.zblproject.erp.utils;

import com.zbl.zblproject.erp.entity.ErpOrder;

import java.time.LocalDateTime;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/10
 * 出入订单工厂
 */
public class ErpOrderFactory {

    private ErpOrderFactory(){}

    /**
     * 生成订单
     * @param orderInfo 订单编号
     * @param user 用户名称
     * @param mode 订单模式
     * @return
     */
    public static ErpOrder createOrder(String orderInfo, String user, int mode){
        ErpOrder erpOrder = new ErpOrder();
        erpOrder.setCreateTime(LocalDateTime.now());
        erpOrder.setOperator(user);
        erpOrder.setStatus(0);
        erpOrder.setMode(mode);
        erpOrder.setOrderInfo(orderInfo);
        return erpOrder;
    }


}
